Object.defineProperty(exports, "__esModule", {
  value: true
});
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_SoundManager = function (e) {
  function _ctor() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.soundEffects = [];
    t.bgms = [];
    return t;
  }
  var o;
  __extends(_ctor, e);
  o = _ctor;
  _ctor.prototype.start = function () {
    o.SoundEffects = [];
    o.Bgms = [];
    for (var e = 0; e < this.soundEffects.length; e++) {
      o.SoundEffects.push(this.soundEffects[e]);
    }
    for (e = 0; e < this.bgms.length; e++) {
      o.Bgms.push(this.bgms[e]);
    }
    o.effPlayTime = {};
  };
  _ctor.playBgm = function (e) {
    cc.butler.playMusic(o.Bgms[e]);
  };
  _ctor.playEffect = function (e) {
    e && cc.butler.playEffect(o.SoundEffects[e]);
  };
  _ctor.playEffect2 = function (e) {
    if (!o.effPlayTime[e] || Date.now() - o.effPlayTime[e] > 100) {
      cc.butler.playEffect(o.SoundEffects[e]);
      o.effPlayTime[e] = Date.now();
    }
  };
  _ctor.SoundEffects = [];
  _ctor.Bgms = [];
  _ctor.effPlayTime = {};
  __decorate([ccp_property(cc.AudioClip)], _ctor.prototype, "soundEffects", undefined);
  __decorate([ccp_property(cc.AudioClip)], _ctor.prototype, "bgms", undefined);
  return o = __decorate([ccp_ccclass], _ctor);
}(cc.Component);
exports.default = def_SoundManager;